package com.axioma.dbmaint.datalayer.util.datasource.impl;

import javax.sql.DataSource;

import com.axioma.dbmaint.datalayer.dto.ServerDTO;
import com.axioma.dbmaint.datalayer.util.datasource.DataSourceFactory;
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;

public class SSDataSourceFactory implements DataSourceFactory {

   @Override
   public DataSource buildDataSource(ServerDTO serverDTO) {
      SQLServerDataSource ssds = new SQLServerDataSource();
      ssds.setServerName(serverDTO.getServerName());
      ssds.setPortNumber(serverDTO.getPort());
      ssds.setDatabaseName(serverDTO.getMasterDatabaseName());
      ssds.setUser(serverDTO.getUser());
      ssds.setPassword(serverDTO.getPassword());
      
      return ssds;
   }

}
